package com.example.actuator.controller;

import com.example.actuator.config.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author void
 * @date 2020/5/24 20:00
 * @desc
 */
@RestController
public class ColorController {
    
    @Autowired
    private Blue blue;
    @Autowired
    private Black black;
    @Autowired
    private Green green;
    @Autowired
    private Red red;

    @GetMapping("/color/{name}")
    public String color(@PathVariable String name){
        if(name.equals("blue")){
            return blue.test();
        }else if(name.equals("black")){
            return black.test();
        }else if(name.equals("green")){
            return green.test();
        }else{
            return red.test();
        }
    }
}
